home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / sgverinf / ENUMFONT.VBS < prev    next >
Text File  |  1998-08-17  |  3KB  |  82 lines

  1. '--------------------------------------------------------------------------
  2. ' EnumFonts.vbs - Enumerates fonts from the system directory
  3. '
  4. ' This file is part of the sgVersionInfo.
  5. ' Copyright (C) 1998 Stinga
  6. ' All rights reserved.
  7. '--------------------------------------------------------------------------
  8.  
  9. on error resume next
  10.  
  11. ' sgFileFlag constants
  12. const sgVS_FF_DEBUG           = &H00000001
  13. const sgVS_FF_PRERELEASE      = &H00000002
  14. const sgVS_FF_PATCHED         = &H00000004
  15. const sgVS_FF_PRIVATEBUILD    = &H00000008
  16. const sgVS_FF_INFOINFERRED    = &H00000010
  17. const sgVS_FF_SPECIALBUILD    = &H00000020
  18.  
  19. ' sgFileOS constants
  20. const sgVOS_UNKNOWN           = &H00000000
  21. const sgVOS_DOS               = &H00010000
  22. const sgVOS_OS216             = &H00020000
  23. const sgVOS_OS232             = &H00030000
  24. const sgVOS_NT                = &H00040000
  25. const sgVOS__BASE             = &H00000000
  26. const sgVOS__WINDOWS16        = &H00000001
  27. const sgVOS__PM16             = &H00000002
  28. const sgVOS__PM32             = &H00000003
  29. const sgVOS__WINDOWS32        = &H00000004
  30. const sgVOS_DOS_WINDOWS16     = &H00010001
  31. const sgVOS_DOS_WINDOWS32     = &H00010004
  32. const sgVOS_OS216_PM16        = &H00020002
  33. const sgVOS_OS232_PM32        = &H00030003
  34. const sgVOS_NT_WINDOWS32      = &H00040004
  35.  
  36. ' sgFileType constants
  37. const sgVFT_UNKNOWN           = &H00000000
  38. const sgVFT_APP               = &H00000001
  39. const sgVFT_DLL               = &H00000002
  40. const sgVFT_DRV               = &H00000003
  41. const sgVFT_FONT              = &H00000004
  42. const sgVFT_VXD               = &H00000005
  43. const sgVFT_STATIC_LIB        = &H00000007
  44.  
  45. ' sgFileSubtype constants
  46. const sgVFT2_UNKNOWN          = &H00000000
  47. const sgVFT2_DRV_PRINTER      = &H00000001
  48. const sgVFT2_DRV_KEYBOARD     = &H00000002
  49. const sgVFT2_DRV_LANGUAGE     = &H00000003
  50. const sgVFT2_DRV_DISPLAY      = &H00000004
  51. const sgVFT2_DRV_MOUSE        = &H00000005
  52. const sgVFT2_DRV_NETWORK      = &H00000006
  53. const sgVFT2_DRV_SYSTEM       = &H00000007
  54. const sgVFT2_DRV_INSTALLABLE  = &H00000008
  55. const sgVFT2_DRV_SOUND        = &H00000009
  56. const sgVFT2_DRV_COMM         = &H0000000A
  57. const sgVFT2_DRV_INPUTMETHOD  = &H0000000B
  58. const sgVFT2_FONT_RASTER      = &H00000001
  59. const sgVFT2_FONT_VECTOR      = &H00000002
  60. const sgVFT2_FONT_TRUETYPE    = &H00000003
  61.  
  62.  
  63. set VerInfo = WScript.CreateObject("SGVersionInfo.VersionInfo")
  64. Set wsh     = WScript.CreateObject("Wscript.Shell")
  65. Set fs      = WScript.CreateObject("Scripting.FileSystemObject")
  66. Set foldr   = fs.GetFolder(wsh.SpecialFolders("Fonts"))
  67.  
  68. for each file in foldr.Files
  69.     VerInfo.Path = file.Path
  70.     if VerInfo.InfoExist And VerInfo.FileType = sgVFT_FONT Then
  71.         rc = WScript.Echo(file.name + " " + cstr(VerInfo.FileType) + ", " + cstr(VerInfo.FileSubtype), 1)
  72.         if rc = 2 then wscript.quit(0)
  73.     end if
  74. next
  75.  
  76. MsgBox "Finished"
  77.  
  78. set VerInfo = nothing
  79. Set wsh     = nothing
  80. Set fs      = nothing
  81. Set foldr   = nothing
  82.